package pers.youqu.item.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import pers.youqu.item.po.Category;

import java.util.List;

/**
 * @author Jason
 * @version 1.0.0
 * @date 2020/12/4 11:40
 * @Description TODO
 */
public interface CategoryMapper extends BaseMapper<Category> {

    // 根据品牌id查询对应分类
    @Select("select tc.* from tb_category_brand tcb , tb_category tc where tcb.category_id = tc.id and tcb.brand_id = #{id}")
    List<Category> findCategoryByBrandId(@Param("id") Long id);
}
